import Vue from 'vue';
import appconst from './appconst'
class Common {
    getUpTree(arr, ReTmp, pid, Isbreak = false) {//获取所有父级 Id 数组 ReTmp为【】
        arr.forEach((element) => {
            if (Isbreak) return true;

            if (element.value == pid) {
                ReTmp.push(element.value);
                Isbreak = true;
                return true;
            }
            if (
                element.children != null &&
                element.children != undefined &&
                element.children.length > 0
            ) {
                var Tmpv = this.getUpTree(element.children, ReTmp, pid, Isbreak);
                if (Tmpv != null && Tmpv.length > 0) {
                    Isbreak = true;
                    //   console.log(Tmpv);

                    Tmpv.push(element.value);
                    ReTmp = Tmpv;
                    //   console.log(ReTmp);
                    return true;
                }
            }
        });
        return ReTmp;
    }
}
const common = new Common();
export default common;